<?php
//匿名类是一种创建和使用同时进行的类,使用完就释放,具有一次性
class Point{
   public $x;
   public $y;
   public function __construct($x,$y) {
    $this->x = $x;
    $this->y = $y;
   }
}

class Rectangle{
    public $point1;
    public $point2;
    public $point3;
    public $point4;
    public function __construct($point1,$point2,$point3,$point4) {
        $this->point1 = $point1;
        $this->point2 = $point2;
        $this->point3 = $point3;
        $this->point4 = $point4;
    }
}
    

$p=new Rectangle(new Point(11,22),new Point(33,44),new Point(11,22),new Point(11,22)) ;
var_dump($p->point1);